#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>

int main()
{
  umask(0);
  int fda=open("loga.txt",O_WRONLY | O_CREAT | O_TRUNC);
  int fdb=open("logb.txt",O_WRONLY | O_CREAT | O_TRUNC);
  int fdc=open("logc.txt",O_WRONLY | O_CREAT | O_TRUNC);
  int fdd=open("logd.txt",O_WRONLY | O_CREAT | O_TRUNC);
  int fde=open("loge.txt",O_WRONLY | O_CREAT | O_TRUNC);

  printf("stdin: %d\n",stdin->_fileno);
  printf("stdout: %d\n",stdout->_fileno);
  printf("stderr: %d\n",stderr->_fileno);
  printf("fda: %d\n",fda);
  printf("fdb: %d\n",fdb);
  printf("fdc: %d\n",fdc);
  printf("fdd: %d\n",fdd);
  printf("fde: %d\n",fde);

  return 0;
}
